import { createRouter, createWebHistory, type RouteRecordRaw } from 'vue-router';
// import Home from '../views/HomeView.vue'
// import About from '../views/AboutView.vue'
// 1. 定义路由规则（使用TypeScript类型校验）
const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'Home',
    component: () => import('../views/HomeView.vue')
  },
  {
    path: '/about',
    name: 'About',
    component: () => import('../views/AboutView.vue')
  }
];

// 2. 创建路由实例
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL), // 使用HTML5历史模式
  routes,
});

// 3. 导出路由实例
export default router;